import pandas as pd 
from sklearn import svm,metrics,model_selection 
import joblib   

class svmm:
    def __init__(self):
        pass
 
def train(x_train,y_train,path="d:/ai/ds/svm.joblib"):
    clf=svm.SVC()
    clf.fit(x_train,y_train)
    joblib.dump(clf,path)

def predict(x_test,path="d:/ai/ds/svm.joblib"):
    loaded_model = joblib.load(path)
    pre=loaded_model.predict(x_test)
    print(pre)
    return pre

def pd(x_test,path="d:/ai/ds/svm.joblib"):
    loaded_model = joblib.load(path)
    pre=loaded_model.predict(x_test)
    print(pre)
    return pre

def test():
    #data = pd.read_csv("d:/ai/ds/iris.csv")  setosa
    x =[ [4.7,3.2,1.3,0.2]]
    predict(x)
test()

